﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Chapter17.View
{
    /// <summary>
    /// GradientButtonTest.xaml 的交互逻辑
    /// </summary>
    public partial class GradientButtonTest2Window : Window
    {
        public GradientButtonTest2Window()
        {
            InitializeComponent();
        }

        private void CheckBox_Click(object sender, RoutedEventArgs e)
        {
            var checkbox = sender as CheckBox;
            if (checkbox != null)
            {
                if ((bool)checkbox.IsChecked)
                {
                    var dict = new ResourceDictionary();
                    dict.Source = new Uri("Resources/GradientButtonsVariant2.xaml", UriKind.Relative);
                    Resources.MergedDictionaries[0] = dict; ;
                }
                else
                {
                    var dict = new ResourceDictionary();
                    dict.Source = new Uri("Resources/GradientButtonsVariant.xaml", UriKind.Relative);
                    Resources.MergedDictionaries[0] = dict; ;
                }
            }
        }
    }
}
